﻿using MediatR;
using RBAC.LuFang.API.Application.Command.MenuCommand;
using RBAC.LuFang.Domain;
using RBAC.LuFang.Domin.Services;

namespace RBAC.LuFang.API.Application.CommandHandlers.MenuHandler
{
    //菜单反填
    public class MenuFanCommandHandler:IRequestHandler<MenuFanCommand,MenuInfo>
    {
        private readonly IMenuService _menuService;

        public MenuFanCommandHandler(IMenuService menuService)
        {
            _menuService = menuService;
        }

        public async Task<MenuInfo> Handle(MenuFanCommand request, CancellationToken cancellationToken)
        {
            return await _menuService.GetByid(request.menuid);
        }
    }
}
